import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { Route, Redirect } from 'react-router'
import { global as userDuck } from 'ducks'

class ReturnRoute extends Component {
  componentDidMount() {
    const { actionCheckReturnUrl } = this.props
    actionCheckReturnUrl()
  }

  render() {
    return null
  }
}

const mapDispatchToProps = {
  actionCheckReturnUrl: userDuck.creators.actionCheckReturnUrl,
}

export default connect(
  null,
  mapDispatchToProps,
)(ReturnRoute)
